<template>
  <div class="app-container">
    <!-- 高级查询 -->
    <el-form v-show="searchVisible" ref="queryForm" :model="queryParams" :inline="true">
      <el-form-item label="销售订单ID:">
        <el-input v-model="queryParams.salesOrderId" size="small" placeholder="请输入销售订单ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="销售订单号:">
        <el-input v-model="queryParams.salesOrderNo" size="small" placeholder="请输入销售订单号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="销售订单明细:">
        <el-input v-model="queryParams.salesOrderItemNo" size="small" placeholder="请输入销售订单明细" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="分类ID:">
        <el-input v-model="queryParams.categoryId" size="small" placeholder="请输入分类ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="分类名称:">
        <el-input v-model="queryParams.categoryName" size="small" placeholder="请输入分类名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="SPU_ID:">
        <el-input v-model="queryParams.spuId" size="small" placeholder="请输入SPU_ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="SPU名称:">
        <el-input v-model="queryParams.spuName" size="small" placeholder="请输入SPU名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="SKU_ID:">
        <el-input v-model="queryParams.skuId" size="small" placeholder="请输入SKU_ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="组合货号编码:">
        <el-input v-model="queryParams.goodGroupId" size="small" placeholder="请输入组合货号编码" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商品名称:">
        <el-input v-model="queryParams.skuName" size="small" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="重量:">
        <el-input v-model="queryParams.weight" size="small" placeholder="请输入重量" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="运费:">
        <el-input v-model="queryParams.freightFee" size="small" placeholder="请输入运费" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="单价:">
        <el-input v-model="queryParams.price" size="small" placeholder="请输入单价" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="数量:">
        <el-input v-model="queryParams.qty" size="small" placeholder="请输入数量" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="总金额:">
        <el-input v-model="queryParams.money" size="small" placeholder="请输入总金额" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="实付金额:">
        <el-input v-model="queryParams.payMoney" size="small" placeholder="请输入实付金额" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="图片地址:">
        <el-input v-model="queryParams.image" size="small" placeholder="请输入图片地址" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="是否退货:">
        <el-input v-model="queryParams.isReturn" size="small" placeholder="请输入是否退货" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="品牌名称:">
        <el-input v-model="queryParams.brandName" size="small" placeholder="请输入品牌名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="店铺ID :">
        <el-input v-model="queryParams.storeId" size="small" placeholder="请输入店铺ID " clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="店铺名称:">
        <el-input v-model="queryParams.storeName" size="small" placeholder="请输入店铺名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="供货商id:">
        <el-input v-model="queryParams.supplierNo" size="small" placeholder="请输入供货商id" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="供货商:">
        <el-input v-model="queryParams.supplierName" size="small" placeholder="请输入供货商" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="供货单价:">
        <el-input v-model="queryParams.buyPrice" size="small" placeholder="请输入供货单价" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="单价:">
        <el-input v-model="queryParams.unitPricePoint" size="small" placeholder="请输入单价" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="销售总金额:">
        <el-input v-model="queryParams.salePricePoint" size="small" placeholder="请输入销售总金额" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="推荐码:">
        <el-input v-model="queryParams.referenceCode" size="small" placeholder="请输入推荐码" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="收货人ID:">
        <el-input v-model="queryParams.consigneeId" size="small" placeholder="请输入收货人ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="收货人名称:">
        <el-input v-model="queryParams.consigneeName" size="small" placeholder="请输入收货人名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="收货人地址:">
        <el-input v-model="queryParams.consigneeAddress" size="small" placeholder="请输入收货人地址" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="售后服务:">
        <el-input v-model="queryParams.afterSaleService" size="small" placeholder="请输入售后服务" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="折扣活动:">
        <el-input v-model="queryParams.discountActivityName" size="small" placeholder="请输入折扣活动" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="折扣活动编号:">
        <el-input v-model="queryParams.discountActivityCode" size="small" placeholder="请输入折扣活动编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="运费:">
        <el-input v-model="queryParams.freightFeePoint" size="small" placeholder="请输入运费" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商家优惠券金额:">
        <el-input v-model="queryParams.storeDiscountAmt" size="small" placeholder="请输入商家优惠券金额" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商家优惠券金额(积分):">
        <el-input v-model="queryParams.storeDiscountAmtPoint" size="small" placeholder="请输入商家优惠券金额(积分)" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商家优惠券活动编号:">
        <el-input v-model="queryParams.storeDiscountActId" size="small" placeholder="请输入商家优惠券活动编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商家优惠券券码:">
        <el-input v-model="queryParams.storeDiscountCode" size="small" placeholder="请输入商家优惠券券码" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商城优惠券金额(里程):">
        <el-input v-model="queryParams.mallDiscountAmt" size="small" placeholder="请输入商城优惠券金额(里程)" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商城优惠券券码:">
        <el-input v-model="queryParams.mallDiscountCode" size="small" placeholder="请输入商城优惠券券码" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商城优惠券活动编号:">
        <el-input v-model="queryParams.mallDiscountActId" size="small" placeholder="请输入商城优惠券活动编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商城买家编号:">
        <el-input v-model="queryParams.mallBuyerNo" size="small" placeholder="请输入商城买家编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="E行会员号:">
        <el-input v-model="queryParams.eMemberShipCardNo" size="small" placeholder="请输入E行会员号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="明珠卡号:">
        <el-input v-model="queryParams.pMemberShipCardNo" size="small" placeholder="请输入明珠卡号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.memberShipcardDegree" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="可疑指数:">
        <el-input v-model="queryParams.suspiciousIndex" size="small" placeholder="请输入可疑指数" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付渠道:">
        <el-input v-model="queryParams.paymentChannalPoint" size="small" placeholder="请输入支付渠道" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付渠道:">
        <el-input v-model="queryParams.paymentChannal" size="small" placeholder="请输入支付渠道" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="UPP支付流水号:">
        <el-input v-model="queryParams.uppPaymentSeqNo" size="small" placeholder="请输入UPP支付流水号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付商:">
        <el-input v-model="queryParams.paymentHandleCompany" size="small" placeholder="请输入支付商" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付商流水号:">
        <el-input v-model="queryParams.paymentHandleCompanySeqNo" size="small" placeholder="请输入支付商流水号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付商:">
        <el-input v-model="queryParams.paymentHandleCompanyPoint" size="small" placeholder="请输入支付商" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付商流水号:">
        <el-input v-model="queryParams.paymentHandleCompanyPonitSeqNo" size="small" placeholder="请输入支付商流水号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.invoiceYn" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.invoiceName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="纳税人识别号:">
        <el-input v-model="queryParams.invoiceBusinessId" size="small" placeholder="请输入纳税人识别号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.buyerRegAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.buyerRegPhone" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.bankName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.bankAccount" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.invoiceReceiverPhone" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.invoiceReceiverEmail" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.orderSource" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="批号:">
        <el-input v-model="queryParams.batchNo" size="small" placeholder="请输入批号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="活动id:">
        <el-input v-model="queryParams.actId" size="small" placeholder="请输入活动id" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.pickUpAddressId" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.pickUpAddress" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.pickUpCode" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.uppPaymentSeqNoPoint" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.custNote" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="客户子订单号:">
        <el-input v-model="queryParams.custSalesOrderItemNo" size="small" placeholder="请输入客户子订单号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="客户SKU 号:">
        <el-input v-model="queryParams.custSkuId" size="small" placeholder="请输入客户SKU 号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.custCashPaymentAmt" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.orderTime" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.deliveryAddTime" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="客户订单号:">
        <el-input v-model="queryParams.custSalesOrderNo" size="small" placeholder="请输入客户订单号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.custMilePaymentAmt" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.customerName" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.customerNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.materialMapId" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.custSpuId" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.site" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.importErrorMesg" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.errorFlag" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.originalQty" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.custRelSalesPrice" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.errorCode" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.returnOrderItemNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.returnAmt" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.returnQty" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.salesOrderItemId" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="订单类型名称:">
        <el-input v-model="queryParams.orderTypeName" size="small" placeholder="请输入订单类型名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="序号:">
        <el-input v-model="queryParams.seq" size="small" placeholder="请输入序号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商城买家编号:">
        <el-input v-model="queryParams.buyerId" size="small" placeholder="请输入商城买家编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付渠道:">
        <el-input v-model="queryParams.mileagePaymentChannel" size="small" placeholder="请输入支付渠道" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="运费:">
        <el-input v-model="queryParams.mileageFreight" size="small" placeholder="请输入运费" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="订单状态名称:">
        <el-input v-model="queryParams.custOrderStatusName" size="small" placeholder="请输入订单状态名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="单价(现金):">
        <el-input v-model="queryParams.payPrice" size="small" placeholder="请输入单价(现金)" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="单价(里程):">
        <el-input v-model="queryParams.mileagePayPrice" size="small" placeholder="请输入单价(里程)" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="售后服务: 进行中  退款关闭  退款成功:">
        <el-input v-model="queryParams.afterServiceName" size="small" placeholder="请输入售后服务: 进行中  退款关闭  退款成功" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="订单配送方式: 1.快递发货、2.上门自提:">
        <el-input v-model="queryParams.orderDistributionWay" size="small" placeholder="请输入订单配送方式: 1.快递发货、2.上门自提" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="渠道终端名称:">
        <el-input v-model="queryParams.orderSourceName" size="small" placeholder="请输入渠道终端名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="折扣活动编号:">
        <el-input v-model="queryParams.activityId" size="small" placeholder="请输入折扣活动编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="折扣活动名称:">
        <el-input v-model="queryParams.activityName" size="small" placeholder="请输入折扣活动名称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付渠道:">
        <el-input v-model="queryParams.paymentChannel" size="small" placeholder="请输入支付渠道" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商家优惠券金额:">
        <el-input v-model="queryParams.couponDiscount" size="small" placeholder="请输入商家优惠券金额" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商家优惠券金额:">
        <el-input v-model="queryParams.mileageCouponDiscount" size="small" placeholder="请输入商家优惠券金额" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="南航-订单来源:">
        <el-input v-model="queryParams.canalName" size="small" placeholder="请输入南航-订单来源" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="支付商:">
        <el-input v-model="queryParams.mileagePaymentTypeName" size="small" placeholder="请输入支付商" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="商品属性:">
        <el-input v-model="queryParams.attributes" size="small" placeholder="请输入商品属性" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.custRelSalesUnitPrice" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.contractNo" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label=":">
        <el-input v-model="queryParams.unit" size="small" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 工具栏 -->
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button v-hasPermission="['order:purchaseOrderItem:insert']" type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['order:purchaseOrderItem:update']" type="success" icon="el-icon-edit" size="mini" :disabled="isSingle" @click="handleEdit">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['order:purchaseOrderItem:delete']" type="danger" icon="el-icon-delete" size="mini" :disabled="isMultiple" @click="handleRemove">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button v-hasPermission="['order:purchaseOrderItem:export']" type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
      </el-col>
      <right-toolbar :show-search.sync="searchVisible" @queryTable="handleQuery" />
    </el-row>

    <!-- 数据列表 -->
    <el-table v-loading="loading" :data="page.records" highlight-current-row @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="销售订单ID" align="center" prop="salesOrderId" />
      <el-table-column label="销售订单号" align="center" prop="salesOrderNo" />
      <el-table-column label="销售订单明细" align="center" prop="salesOrderItemNo" />
      <el-table-column label="分类ID" align="center" prop="categoryId" />
      <el-table-column label="分类名称" align="center" prop="categoryName" />
      <el-table-column label="SPU_ID" align="center" prop="spuId" />
      <el-table-column label="SPU名称" align="center" prop="spuName" />
      <el-table-column label="SKU_ID" align="center" prop="skuId" />
      <el-table-column label="组合货号编码" align="center" prop="goodGroupId" />
      <el-table-column label="商品名称" align="center" prop="skuName" />
      <el-table-column label="重量" align="center" prop="weight" />
      <el-table-column label="运费" align="center" prop="freightFee" />
      <el-table-column label="单价" align="center" prop="price" />
      <el-table-column label="数量" align="center" prop="qty" />
      <el-table-column label="总金额" align="center" prop="money" />
      <el-table-column label="实付金额" align="center" prop="payMoney" />
      <el-table-column label="图片地址" align="center" prop="image" />
      <el-table-column label="是否退货" align="center" prop="isReturn" />
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="品牌名称" align="center" prop="brandName" />
      <el-table-column label="店铺ID " align="center" prop="storeId" />
      <el-table-column label="店铺名称" align="center" prop="storeName" />
      <el-table-column label="供货商id" align="center" prop="supplierNo" />
      <el-table-column label="供货商" align="center" prop="supplierName" />
      <el-table-column label="供货单价" align="center" prop="buyPrice" />
      <el-table-column label="单价" align="center" prop="unitPricePoint" />
      <el-table-column label="销售总金额" align="center" prop="salePricePoint" />
      <el-table-column label="付款类型" align="center" prop="paymentType" />
      <el-table-column label="推荐码" align="center" prop="referenceCode" />
      <el-table-column label="收货人ID" align="center" prop="consigneeId" />
      <el-table-column label="收货人名称" align="center" prop="consigneeName" />
      <el-table-column label="收货人地址" align="center" prop="consigneeAddress" />
      <el-table-column label="收货人电话" align="center" prop="consigneePhone" />
      <el-table-column label="售后服务" align="center" prop="afterSaleService" />
      <el-table-column label="商品属性" align="center" prop="productAttribution" />
      <el-table-column label="折扣活动" align="center" prop="discountActivityName" />
      <el-table-column label="折扣活动编号" align="center" prop="discountActivityCode" />
      <el-table-column label="运费" align="center" prop="freightFeePoint" />
      <el-table-column label="商家优惠券金额" align="center" prop="storeDiscountAmt" />
      <el-table-column label="商家优惠券金额(积分)" align="center" prop="storeDiscountAmtPoint" />
      <el-table-column label="商家优惠券活动编号" align="center" prop="storeDiscountActId" />
      <el-table-column label="商家优惠券券码" align="center" prop="storeDiscountCode" />
      <el-table-column label="商城优惠券金额(里程)" align="center" prop="mallDiscountAmt" />
      <el-table-column label="商城优惠券券码" align="center" prop="mallDiscountCode" />
      <el-table-column label="商城优惠券活动编号" align="center" prop="mallDiscountActId" />
      <el-table-column label="商城买家编号" align="center" prop="mallBuyerNo" />
      <el-table-column label="E行会员号" align="center" prop="eMemberShipCardNo" />
      <el-table-column label="明珠卡号" align="center" prop="pMemberShipCardNo" />
      <el-table-column label="" align="center" prop="memberShipcardDegree" />
      <el-table-column label="可疑指数" align="center" prop="suspiciousIndex" />
      <el-table-column label="支付状态" align="center" prop="paymentStatus" />
      <el-table-column label="配送状态" align="center" prop="deliveryStatus" />
      <el-table-column label="支付渠道" align="center" prop="paymentChannalPoint" />
      <el-table-column label="支付渠道" align="center" prop="paymentChannal" />
      <el-table-column label="UPP支付流水号" align="center" prop="uppPaymentSeqNo" />
      <el-table-column label="支付商" align="center" prop="paymentHandleCompany" />
      <el-table-column label="支付商流水号" align="center" prop="paymentHandleCompanySeqNo" />
      <el-table-column label="支付商" align="center" prop="paymentHandleCompanyPoint" />
      <el-table-column label="支付商流水号" align="center" prop="paymentHandleCompanyPonitSeqNo" />
      <el-table-column label="" align="center" prop="invoiceYn" />
      <el-table-column label="" align="center" prop="invoiceType" />
      <el-table-column label="" align="center" prop="invoiceName" />
      <el-table-column label="纳税人识别号" align="center" prop="invoiceBusinessId" />
      <el-table-column label="" align="center" prop="buyerRegAddress" />
      <el-table-column label="" align="center" prop="buyerRegPhone" />
      <el-table-column label="" align="center" prop="bankName" />
      <el-table-column label="" align="center" prop="bankAccount" />
      <el-table-column label="" align="center" prop="invoiceContent" />
      <el-table-column label="" align="center" prop="invoiceReceiverPhone" />
      <el-table-column label="" align="center" prop="invoiceReceiverEmail" />
      <el-table-column label="" align="center" prop="orderSource" />
      <el-table-column label="批号" align="center" prop="batchNo" />
      <el-table-column label="活动id" align="center" prop="actId" />
      <el-table-column label="" align="center" prop="orderType" />
      <el-table-column label="" align="center" prop="pickUpAddressId" />
      <el-table-column label="" align="center" prop="pickUpAddress" />
      <el-table-column label="" align="center" prop="pickUpCode" />
      <el-table-column label="" align="center" prop="genAccFailedReason" />
      <el-table-column label="" align="center" prop="status" />
      <el-table-column label="" align="center" prop="uppPaymentSeqNoPoint" />
      <el-table-column label="" align="center" prop="custNote" />
      <el-table-column label="客户子订单号" align="center" prop="custSalesOrderItemNo" />
      <el-table-column label="客户SKU 号" align="center" prop="custSkuId" />
      <el-table-column label="" align="center" prop="custCashPaymentAmt" />
      <el-table-column label="" align="center" prop="orderTime" />
      <el-table-column label="" align="center" prop="deliveryAddTime" />
      <el-table-column label="客户订单号" align="center" prop="custSalesOrderNo" />
      <el-table-column label="" align="center" prop="custMilePaymentAmt" />
      <el-table-column label="" align="center" prop="custOrderStatus" />
      <el-table-column label="" align="center" prop="customerName" />
      <el-table-column label="" align="center" prop="customerNo" />
      <el-table-column label="" align="center" prop="materialMapId" />
      <el-table-column label="" align="center" prop="custSpuId" />
      <el-table-column label="" align="center" prop="site" />
      <el-table-column label="" align="center" prop="importErrorMesg" />
      <el-table-column label="" align="center" prop="errorFlag" />
      <el-table-column label="" align="center" prop="originalQty" />
      <el-table-column label="" align="center" prop="custRelSalesPrice" />
      <el-table-column label="" align="center" prop="errorCode" />
      <el-table-column label="" align="center" prop="returnOrderItemNo" />
      <el-table-column label="" align="center" prop="returnAmt" />
      <el-table-column label="" align="center" prop="returnQty" />
      <el-table-column label="" align="center" prop="salesOrderItemId" />
      <el-table-column label="订单类型名称" align="center" prop="orderTypeName" />
      <el-table-column label="序号" align="center" prop="seq" />
      <el-table-column label="商城买家编号" align="center" prop="buyerId" />
      <el-table-column label="退款类型 1 ： 普通退款 2：里程退款" align="center" prop="returnType" />
      <el-table-column label="支付渠道" align="center" prop="mileagePaymentChannel" />
      <el-table-column label="支付类型: 1现金支付  10里程支付  11混合支付" align="center" prop="shipmentType" />
      <el-table-column label="运费" align="center" prop="mileageFreight" />
      <el-table-column label="订单状态名称" align="center" prop="custOrderStatusName" />
      <el-table-column label="单价(现金)" align="center" prop="payPrice" />
      <el-table-column label="单价(里程)" align="center" prop="mileagePayPrice" />
      <el-table-column label="售后服务: 进行中  退款关闭  退款成功" align="center" prop="afterServiceName" />
      <el-table-column label="订单配送方式: 1.快递发货、2.上门自提" align="center" prop="orderDistributionWay" />
      <el-table-column label="渠道终端名称" align="center" prop="orderSourceName" />
      <el-table-column label="折扣活动编号" align="center" prop="activityId" />
      <el-table-column label="折扣活动名称" align="center" prop="activityName" />
      <el-table-column label="支付渠道" align="center" prop="paymentChannel" />
      <el-table-column label="商家优惠券金额" align="center" prop="couponDiscount" />
      <el-table-column label="商家优惠券金额" align="center" prop="mileageCouponDiscount" />
      <el-table-column label="南航-订单来源" align="center" prop="canalName" />
      <el-table-column label="支付商" align="center" prop="mileagePaymentTypeName" />
      <el-table-column label="商品属性" align="center" prop="attributes" />
      <el-table-column label="" align="center" prop="custRelSalesUnitPrice" />
      <el-table-column label="" align="center" prop="supplierStatus" />
      <el-table-column label="" align="center" prop="contractNo" />
      <el-table-column label="" align="center" prop="unit" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button v-hasPermission="['order:purchaseOrderItem:update']" size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">修改</el-button>
          <el-button v-hasPermission="['order:purchaseOrderItem:delete']" size="mini" type="text" icon="el-icon-delete" @click="handleRemove(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页 -->
    <pagination v-show="page.total>0" :total="page.total" :page.sync="page.current" :limit.sync="page.pageSize" @pagination="handleQuery" />

    <!-- 添加/修改对话框 -->
    <el-dialog :title="purchaseOrderItemFormDialog.title" :visible.sync="purchaseOrderItemFormDialog.visible" :close-on-click-modal="false" :before-close="resetPurchaseOrderItemFormDialog" width="500px" append-to-body>
      <el-form ref="purchaseOrderItemForm" :model="purchaseOrderItemFormData" :rules="purchaseOrderItemFormRules" label-width="80px">
        <el-form-item label="销售订单ID" prop="salesOrderId">
          <el-input v-model="purchaseOrderItemFormData.salesOrderId" placeholder="请输入销售订单ID" />
        </el-form-item>
        <el-form-item label="销售订单号" prop="salesOrderNo">
          <el-input v-model="purchaseOrderItemFormData.salesOrderNo" placeholder="请输入销售订单号" />
        </el-form-item>
        <el-form-item label="销售订单明细" prop="salesOrderItemNo">
          <el-input v-model="purchaseOrderItemFormData.salesOrderItemNo" placeholder="请输入销售订单明细" />
        </el-form-item>
        <el-form-item label="分类ID" prop="categoryId">
          <el-input v-model="purchaseOrderItemFormData.categoryId" placeholder="请输入分类ID" />
        </el-form-item>
        <el-form-item label="分类名称" prop="categoryName">
          <el-input v-model="purchaseOrderItemFormData.categoryName" placeholder="请输入分类名称" />
        </el-form-item>
        <el-form-item label="SPU_ID" prop="spuId">
          <el-input v-model="purchaseOrderItemFormData.spuId" placeholder="请输入SPU_ID" />
        </el-form-item>
        <el-form-item label="SPU名称" prop="spuName">
          <el-input v-model="purchaseOrderItemFormData.spuName" placeholder="请输入SPU名称" />
        </el-form-item>
        <el-form-item label="SKU_ID" prop="skuId">
          <el-input v-model="purchaseOrderItemFormData.skuId" placeholder="请输入SKU_ID" />
        </el-form-item>
        <el-form-item label="组合货号编码" prop="goodGroupId">
          <el-input v-model="purchaseOrderItemFormData.goodGroupId" placeholder="请输入组合货号编码" />
        </el-form-item>
        <el-form-item label="商品名称" prop="skuName">
          <el-input v-model="purchaseOrderItemFormData.skuName" placeholder="请输入商品名称" />
        </el-form-item>
        <el-form-item label="重量" prop="weight">
          <el-input v-model="purchaseOrderItemFormData.weight" placeholder="请输入重量" />
        </el-form-item>
        <el-form-item label="运费" prop="freightFee">
          <el-input v-model="purchaseOrderItemFormData.freightFee" placeholder="请输入运费" />
        </el-form-item>
        <el-form-item label="单价" prop="price">
          <el-input v-model="purchaseOrderItemFormData.price" placeholder="请输入单价" />
        </el-form-item>
        <el-form-item label="数量" prop="qty">
          <el-input v-model="purchaseOrderItemFormData.qty" placeholder="请输入数量" />
        </el-form-item>
        <el-form-item label="总金额" prop="money">
          <el-input v-model="purchaseOrderItemFormData.money" placeholder="请输入总金额" />
        </el-form-item>
        <el-form-item label="实付金额" prop="payMoney">
          <el-input v-model="purchaseOrderItemFormData.payMoney" placeholder="请输入实付金额" />
        </el-form-item>
        <el-form-item label="图片地址" prop="image">
          <el-input v-model="purchaseOrderItemFormData.image" placeholder="请输入图片地址" />
        </el-form-item>
        <el-form-item label="是否退货" prop="isReturn">
          <el-input v-model="purchaseOrderItemFormData.isReturn" placeholder="请输入是否退货" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="purchaseOrderItemFormData.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="品牌名称" prop="brandName">
          <el-input v-model="purchaseOrderItemFormData.brandName" placeholder="请输入品牌名称" />
        </el-form-item>
        <el-form-item label="店铺ID " prop="storeId">
          <el-input v-model="purchaseOrderItemFormData.storeId" placeholder="请输入店铺ID " />
        </el-form-item>
        <el-form-item label="店铺名称" prop="storeName">
          <el-input v-model="purchaseOrderItemFormData.storeName" placeholder="请输入店铺名称" />
        </el-form-item>
        <el-form-item label="供货商id" prop="supplierNo">
          <el-input v-model="purchaseOrderItemFormData.supplierNo" placeholder="请输入供货商id" />
        </el-form-item>
        <el-form-item label="供货商" prop="supplierName">
          <el-input v-model="purchaseOrderItemFormData.supplierName" placeholder="请输入供货商" />
        </el-form-item>
        <el-form-item label="供货单价" prop="buyPrice">
          <el-input v-model="purchaseOrderItemFormData.buyPrice" placeholder="请输入供货单价" />
        </el-form-item>
        <el-form-item label="单价" prop="unitPricePoint">
          <el-input v-model="purchaseOrderItemFormData.unitPricePoint" placeholder="请输入单价" />
        </el-form-item>
        <el-form-item label="销售总金额" prop="salePricePoint">
          <el-input v-model="purchaseOrderItemFormData.salePricePoint" placeholder="请输入销售总金额" />
        </el-form-item>
        <el-form-item label="推荐码" prop="referenceCode">
          <el-input v-model="purchaseOrderItemFormData.referenceCode" placeholder="请输入推荐码" />
        </el-form-item>
        <el-form-item label="收货人ID" prop="consigneeId">
          <el-input v-model="purchaseOrderItemFormData.consigneeId" placeholder="请输入收货人ID" />
        </el-form-item>
        <el-form-item label="收货人名称" prop="consigneeName">
          <el-input v-model="purchaseOrderItemFormData.consigneeName" placeholder="请输入收货人名称" />
        </el-form-item>
        <el-form-item label="收货人地址" prop="consigneeAddress">
          <el-input v-model="purchaseOrderItemFormData.consigneeAddress" placeholder="请输入收货人地址" />
        </el-form-item>
        <el-form-item label="收货人电话" prop="consigneePhone">
          <el-input v-model="purchaseOrderItemFormData.consigneePhone" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="售后服务" prop="afterSaleService">
          <el-input v-model="purchaseOrderItemFormData.afterSaleService" placeholder="请输入售后服务" />
        </el-form-item>
        <el-form-item label="商品属性" prop="productAttribution">
          <el-input v-model="purchaseOrderItemFormData.productAttribution" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="折扣活动" prop="discountActivityName">
          <el-input v-model="purchaseOrderItemFormData.discountActivityName" placeholder="请输入折扣活动" />
        </el-form-item>
        <el-form-item label="折扣活动编号" prop="discountActivityCode">
          <el-input v-model="purchaseOrderItemFormData.discountActivityCode" placeholder="请输入折扣活动编号" />
        </el-form-item>
        <el-form-item label="运费" prop="freightFeePoint">
          <el-input v-model="purchaseOrderItemFormData.freightFeePoint" placeholder="请输入运费" />
        </el-form-item>
        <el-form-item label="商家优惠券金额" prop="storeDiscountAmt">
          <el-input v-model="purchaseOrderItemFormData.storeDiscountAmt" placeholder="请输入商家优惠券金额" />
        </el-form-item>
        <el-form-item label="商家优惠券金额(积分)" prop="storeDiscountAmtPoint">
          <el-input v-model="purchaseOrderItemFormData.storeDiscountAmtPoint" placeholder="请输入商家优惠券金额(积分)" />
        </el-form-item>
        <el-form-item label="商家优惠券活动编号" prop="storeDiscountActId">
          <el-input v-model="purchaseOrderItemFormData.storeDiscountActId" placeholder="请输入商家优惠券活动编号" />
        </el-form-item>
        <el-form-item label="商家优惠券券码" prop="storeDiscountCode">
          <el-input v-model="purchaseOrderItemFormData.storeDiscountCode" placeholder="请输入商家优惠券券码" />
        </el-form-item>
        <el-form-item label="商城优惠券金额(里程)" prop="mallDiscountAmt">
          <el-input v-model="purchaseOrderItemFormData.mallDiscountAmt" placeholder="请输入商城优惠券金额(里程)" />
        </el-form-item>
        <el-form-item label="商城优惠券券码" prop="mallDiscountCode">
          <el-input v-model="purchaseOrderItemFormData.mallDiscountCode" placeholder="请输入商城优惠券券码" />
        </el-form-item>
        <el-form-item label="商城优惠券活动编号" prop="mallDiscountActId">
          <el-input v-model="purchaseOrderItemFormData.mallDiscountActId" placeholder="请输入商城优惠券活动编号" />
        </el-form-item>
        <el-form-item label="商城买家编号" prop="mallBuyerNo">
          <el-input v-model="purchaseOrderItemFormData.mallBuyerNo" placeholder="请输入商城买家编号" />
        </el-form-item>
        <el-form-item label="E行会员号" prop="eMemberShipCardNo">
          <el-input v-model="purchaseOrderItemFormData.eMemberShipCardNo" placeholder="请输入E行会员号" />
        </el-form-item>
        <el-form-item label="明珠卡号" prop="pMemberShipCardNo">
          <el-input v-model="purchaseOrderItemFormData.pMemberShipCardNo" placeholder="请输入明珠卡号" />
        </el-form-item>
        <el-form-item label="" prop="memberShipcardDegree">
          <el-input v-model="purchaseOrderItemFormData.memberShipcardDegree" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="可疑指数" prop="suspiciousIndex">
          <el-input v-model="purchaseOrderItemFormData.suspiciousIndex" placeholder="请输入可疑指数" />
        </el-form-item>
        <el-form-item label="支付渠道" prop="paymentChannalPoint">
          <el-input v-model="purchaseOrderItemFormData.paymentChannalPoint" placeholder="请输入支付渠道" />
        </el-form-item>
        <el-form-item label="支付渠道" prop="paymentChannal">
          <el-input v-model="purchaseOrderItemFormData.paymentChannal" placeholder="请输入支付渠道" />
        </el-form-item>
        <el-form-item label="UPP支付流水号" prop="uppPaymentSeqNo">
          <el-input v-model="purchaseOrderItemFormData.uppPaymentSeqNo" placeholder="请输入UPP支付流水号" />
        </el-form-item>
        <el-form-item label="支付商" prop="paymentHandleCompany">
          <el-input v-model="purchaseOrderItemFormData.paymentHandleCompany" placeholder="请输入支付商" />
        </el-form-item>
        <el-form-item label="支付商流水号" prop="paymentHandleCompanySeqNo">
          <el-input v-model="purchaseOrderItemFormData.paymentHandleCompanySeqNo" placeholder="请输入支付商流水号" />
        </el-form-item>
        <el-form-item label="支付商" prop="paymentHandleCompanyPoint">
          <el-input v-model="purchaseOrderItemFormData.paymentHandleCompanyPoint" placeholder="请输入支付商" />
        </el-form-item>
        <el-form-item label="支付商流水号" prop="paymentHandleCompanyPonitSeqNo">
          <el-input v-model="purchaseOrderItemFormData.paymentHandleCompanyPonitSeqNo" placeholder="请输入支付商流水号" />
        </el-form-item>
        <el-form-item label="" prop="invoiceYn">
          <el-input v-model="purchaseOrderItemFormData.invoiceYn" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="invoiceName">
          <el-input v-model="purchaseOrderItemFormData.invoiceName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="纳税人识别号" prop="invoiceBusinessId">
          <el-input v-model="purchaseOrderItemFormData.invoiceBusinessId" placeholder="请输入纳税人识别号" />
        </el-form-item>
        <el-form-item label="" prop="buyerRegAddress">
          <el-input v-model="purchaseOrderItemFormData.buyerRegAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="buyerRegPhone">
          <el-input v-model="purchaseOrderItemFormData.buyerRegPhone" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="bankName">
          <el-input v-model="purchaseOrderItemFormData.bankName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="bankAccount">
          <el-input v-model="purchaseOrderItemFormData.bankAccount" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="">
          <tinymce v-model="purchaseOrderItemFormData.invoiceContent" :min-height="192" />
        </el-form-item>
        <el-form-item label="" prop="invoiceReceiverPhone">
          <el-input v-model="purchaseOrderItemFormData.invoiceReceiverPhone" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="invoiceReceiverEmail">
          <el-input v-model="purchaseOrderItemFormData.invoiceReceiverEmail" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="orderSource">
          <el-input v-model="purchaseOrderItemFormData.orderSource" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="批号" prop="batchNo">
          <el-input v-model="purchaseOrderItemFormData.batchNo" placeholder="请输入批号" />
        </el-form-item>
        <el-form-item label="活动id" prop="actId">
          <el-input v-model="purchaseOrderItemFormData.actId" placeholder="请输入活动id" />
        </el-form-item>
        <el-form-item label="" prop="pickUpAddressId">
          <el-input v-model="purchaseOrderItemFormData.pickUpAddressId" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="pickUpAddress">
          <el-input v-model="purchaseOrderItemFormData.pickUpAddress" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="pickUpCode">
          <el-input v-model="purchaseOrderItemFormData.pickUpCode" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="genAccFailedReason">
          <el-input v-model="purchaseOrderItemFormData.genAccFailedReason" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="" prop="uppPaymentSeqNoPoint">
          <el-input v-model="purchaseOrderItemFormData.uppPaymentSeqNoPoint" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="custNote">
          <el-input v-model="purchaseOrderItemFormData.custNote" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="客户子订单号" prop="custSalesOrderItemNo">
          <el-input v-model="purchaseOrderItemFormData.custSalesOrderItemNo" placeholder="请输入客户子订单号" />
        </el-form-item>
        <el-form-item label="客户SKU 号" prop="custSkuId">
          <el-input v-model="purchaseOrderItemFormData.custSkuId" placeholder="请输入客户SKU 号" />
        </el-form-item>
        <el-form-item label="" prop="custCashPaymentAmt">
          <el-input v-model="purchaseOrderItemFormData.custCashPaymentAmt" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="orderTime">
          <el-input v-model="purchaseOrderItemFormData.orderTime" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="deliveryAddTime">
          <el-input v-model="purchaseOrderItemFormData.deliveryAddTime" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="客户订单号" prop="custSalesOrderNo">
          <el-input v-model="purchaseOrderItemFormData.custSalesOrderNo" placeholder="请输入客户订单号" />
        </el-form-item>
        <el-form-item label="" prop="custMilePaymentAmt">
          <el-input v-model="purchaseOrderItemFormData.custMilePaymentAmt" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="customerName">
          <el-input v-model="purchaseOrderItemFormData.customerName" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="customerNo">
          <el-input v-model="purchaseOrderItemFormData.customerNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="materialMapId">
          <el-input v-model="purchaseOrderItemFormData.materialMapId" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="custSpuId">
          <el-input v-model="purchaseOrderItemFormData.custSpuId" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="site">
          <el-input v-model="purchaseOrderItemFormData.site" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="importErrorMesg">
          <el-input v-model="purchaseOrderItemFormData.importErrorMesg" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="errorFlag">
          <el-input v-model="purchaseOrderItemFormData.errorFlag" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="originalQty">
          <el-input v-model="purchaseOrderItemFormData.originalQty" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="custRelSalesPrice">
          <el-input v-model="purchaseOrderItemFormData.custRelSalesPrice" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="errorCode">
          <el-input v-model="purchaseOrderItemFormData.errorCode" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="returnOrderItemNo">
          <el-input v-model="purchaseOrderItemFormData.returnOrderItemNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="returnAmt">
          <el-input v-model="purchaseOrderItemFormData.returnAmt" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="returnQty">
          <el-input v-model="purchaseOrderItemFormData.returnQty" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="salesOrderItemId">
          <el-input v-model="purchaseOrderItemFormData.salesOrderItemId" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="订单类型名称" prop="orderTypeName">
          <el-input v-model="purchaseOrderItemFormData.orderTypeName" placeholder="请输入订单类型名称" />
        </el-form-item>
        <el-form-item label="序号" prop="seq">
          <el-input v-model="purchaseOrderItemFormData.seq" placeholder="请输入序号" />
        </el-form-item>
        <el-form-item label="商城买家编号" prop="buyerId">
          <el-input v-model="purchaseOrderItemFormData.buyerId" placeholder="请输入商城买家编号" />
        </el-form-item>
        <el-form-item label="支付渠道" prop="mileagePaymentChannel">
          <el-input v-model="purchaseOrderItemFormData.mileagePaymentChannel" placeholder="请输入支付渠道" />
        </el-form-item>
        <el-form-item label="运费" prop="mileageFreight">
          <el-input v-model="purchaseOrderItemFormData.mileageFreight" placeholder="请输入运费" />
        </el-form-item>
        <el-form-item label="订单状态名称" prop="custOrderStatusName">
          <el-input v-model="purchaseOrderItemFormData.custOrderStatusName" placeholder="请输入订单状态名称" />
        </el-form-item>
        <el-form-item label="单价(现金)" prop="payPrice">
          <el-input v-model="purchaseOrderItemFormData.payPrice" placeholder="请输入单价(现金)" />
        </el-form-item>
        <el-form-item label="单价(里程)" prop="mileagePayPrice">
          <el-input v-model="purchaseOrderItemFormData.mileagePayPrice" placeholder="请输入单价(里程)" />
        </el-form-item>
        <el-form-item label="售后服务: 进行中  退款关闭  退款成功" prop="afterServiceName">
          <el-input v-model="purchaseOrderItemFormData.afterServiceName" placeholder="请输入售后服务: 进行中  退款关闭  退款成功" />
        </el-form-item>
        <el-form-item label="订单配送方式: 1.快递发货、2.上门自提" prop="orderDistributionWay">
          <el-input v-model="purchaseOrderItemFormData.orderDistributionWay" placeholder="请输入订单配送方式: 1.快递发货、2.上门自提" />
        </el-form-item>
        <el-form-item label="渠道终端名称" prop="orderSourceName">
          <el-input v-model="purchaseOrderItemFormData.orderSourceName" placeholder="请输入渠道终端名称" />
        </el-form-item>
        <el-form-item label="折扣活动编号" prop="activityId">
          <el-input v-model="purchaseOrderItemFormData.activityId" placeholder="请输入折扣活动编号" />
        </el-form-item>
        <el-form-item label="折扣活动名称" prop="activityName">
          <el-input v-model="purchaseOrderItemFormData.activityName" placeholder="请输入折扣活动名称" />
        </el-form-item>
        <el-form-item label="支付渠道" prop="paymentChannel">
          <el-input v-model="purchaseOrderItemFormData.paymentChannel" placeholder="请输入支付渠道" />
        </el-form-item>
        <el-form-item label="商家优惠券金额" prop="couponDiscount">
          <el-input v-model="purchaseOrderItemFormData.couponDiscount" placeholder="请输入商家优惠券金额" />
        </el-form-item>
        <el-form-item label="商家优惠券金额" prop="mileageCouponDiscount">
          <el-input v-model="purchaseOrderItemFormData.mileageCouponDiscount" placeholder="请输入商家优惠券金额" />
        </el-form-item>
        <el-form-item label="南航-订单来源" prop="canalName">
          <el-input v-model="purchaseOrderItemFormData.canalName" placeholder="请输入南航-订单来源" />
        </el-form-item>
        <el-form-item label="支付商" prop="mileagePaymentTypeName">
          <el-input v-model="purchaseOrderItemFormData.mileagePaymentTypeName" placeholder="请输入支付商" />
        </el-form-item>
        <el-form-item label="商品属性" prop="attributes">
          <el-input v-model="purchaseOrderItemFormData.attributes" placeholder="请输入商品属性" />
        </el-form-item>
        <el-form-item label="" prop="custRelSalesUnitPrice">
          <el-input v-model="purchaseOrderItemFormData.custRelSalesUnitPrice" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="contractNo">
          <el-input v-model="purchaseOrderItemFormData.contractNo" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="" prop="unit">
          <el-input v-model="purchaseOrderItemFormData.unit" placeholder="请输入" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirmPurchaseOrderItemFormDialog">确 定</el-button>
        <el-button @click="resetPurchaseOrderItemFormDialog">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import PurchaseOrderItemApi from '@/api/order/PurchaseOrderItemApi'
import Tinymce from '@/components/Tinymce'

const defaultPurchaseOrderItemFormData = {
  salesOrderId: null,

  salesOrderNo: null,

  salesOrderItemNo: null,

  categoryId: null,

  categoryName: null,

  spuId: null,

  spuName: null,

  skuId: null,

  goodGroupId: null,

  skuName: null,

  weight: null,

  freightFee: null,

  price: null,

  qty: null,

  money: null,

  payMoney: null,

  image: null,

  isReturn: null,

  brandName: null,

  storeId: null,

  storeName: null,

  supplierNo: null,

  supplierName: null,

  buyPrice: null,

  unitPricePoint: null,

  salePricePoint: null,

  paymentType: null,

  referenceCode: null,

  consigneeId: null,

  consigneeName: null,

  consigneeAddress: null,

  consigneePhone: null,

  afterSaleService: null,

  productAttribution: null,

  discountActivityName: null,

  discountActivityCode: null,

  freightFeePoint: null,

  storeDiscountAmt: null,

  storeDiscountAmtPoint: null,

  storeDiscountActId: null,

  storeDiscountCode: null,

  mallDiscountAmt: null,

  mallDiscountCode: null,

  mallDiscountActId: null,

  mallBuyerNo: null,

  eMemberShipCardNo: null,

  pMemberShipCardNo: null,

  memberShipcardDegree: null,

  suspiciousIndex: null,

  paymentStatus: '0',

  deliveryStatus: '0',

  paymentChannalPoint: null,

  paymentChannal: null,

  uppPaymentSeqNo: null,

  paymentHandleCompany: null,

  paymentHandleCompanySeqNo: null,

  paymentHandleCompanyPoint: null,

  paymentHandleCompanyPonitSeqNo: null,

  invoiceYn: null,

  invoiceType: null,

  invoiceName: null,

  invoiceBusinessId: null,

  buyerRegAddress: null,

  buyerRegPhone: null,

  bankName: null,

  bankAccount: null,

  invoiceContent: null,

  invoiceReceiverPhone: null,

  invoiceReceiverEmail: null,

  orderSource: null,

  batchNo: null,

  actId: null,

  orderType: null,

  pickUpAddressId: null,

  pickUpAddress: null,

  pickUpCode: null,

  genAccFailedReason: null,

  status: '0',

  uppPaymentSeqNoPoint: null,

  custNote: null,

  custSalesOrderItemNo: null,

  custSkuId: null,

  custCashPaymentAmt: null,

  orderTime: null,

  deliveryAddTime: null,

  custSalesOrderNo: null,

  custMilePaymentAmt: null,

  custOrderStatus: '0',

  customerName: null,

  customerNo: null,

  materialMapId: null,

  custSpuId: null,

  site: null,

  importErrorMesg: null,

  errorFlag: null,

  originalQty: null,

  custRelSalesPrice: null,

  errorCode: null,

  returnOrderItemNo: null,

  returnAmt: null,

  returnQty: null,

  salesOrderItemId: null,

  orderTypeName: null,

  seq: null,

  buyerId: null,

  returnType: null,

  mileagePaymentChannel: null,

  shipmentType: null,

  mileageFreight: null,

  custOrderStatusName: null,

  payPrice: null,

  mileagePayPrice: null,

  afterServiceName: null,

  orderDistributionWay: null,

  orderSourceName: null,

  activityId: null,

  activityName: null,

  paymentChannel: null,

  couponDiscount: null,

  mileageCouponDiscount: null,

  canalName: null,

  mileagePaymentTypeName: null,

  attributes: null,

  custRelSalesUnitPrice: null,

  supplierStatus: '0',

  contractNo: null,

  unit: null,

}
export default {
  name: 'PurchaseOrderItemList',
  components: { Tinymce },
  data() {
    return {
      options: {
        sysYnTypeOptions: this.$constant.sysYnTypeOptions
      },
      queryParams: {
        salesOrderId: null,
        salesOrderNo: null,
        salesOrderItemNo: null,
        categoryId: null,
        categoryName: null,
        spuId: null,
        spuName: null,
        skuId: null,
        goodGroupId: null,
        skuName: null,
        weight: null,
        freightFee: null,
        price: null,
        qty: null,
        money: null,
        payMoney: null,
        image: null,
        isReturn: null,
        brandName: null,
        storeId: null,
        storeName: null,
        supplierNo: null,
        supplierName: null,
        buyPrice: null,
        unitPricePoint: null,
        salePricePoint: null,
        paymentType: null,
        referenceCode: null,
        consigneeId: null,
        consigneeName: null,
        consigneeAddress: null,
        consigneePhone: null,
        afterSaleService: null,
        productAttribution: null,
        discountActivityName: null,
        discountActivityCode: null,
        freightFeePoint: null,
        storeDiscountAmt: null,
        storeDiscountAmtPoint: null,
        storeDiscountActId: null,
        storeDiscountCode: null,
        mallDiscountAmt: null,
        mallDiscountCode: null,
        mallDiscountActId: null,
        mallBuyerNo: null,
        eMemberShipCardNo: null,
        pMemberShipCardNo: null,
        memberShipcardDegree: null,
        suspiciousIndex: null,
        paymentStatus: null,
        deliveryStatus: null,
        paymentChannalPoint: null,
        paymentChannal: null,
        uppPaymentSeqNo: null,
        paymentHandleCompany: null,
        paymentHandleCompanySeqNo: null,
        paymentHandleCompanyPoint: null,
        paymentHandleCompanyPonitSeqNo: null,
        invoiceYn: null,
        invoiceType: null,
        invoiceName: null,
        invoiceBusinessId: null,
        buyerRegAddress: null,
        buyerRegPhone: null,
        bankName: null,
        bankAccount: null,
        invoiceContent: null,
        invoiceReceiverPhone: null,
        invoiceReceiverEmail: null,
        orderSource: null,
        batchNo: null,
        actId: null,
        orderType: null,
        pickUpAddressId: null,
        pickUpAddress: null,
        pickUpCode: null,
        genAccFailedReason: null,
        status: null,
        uppPaymentSeqNoPoint: null,
        custNote: null,
        custSalesOrderItemNo: null,
        custSkuId: null,
        custCashPaymentAmt: null,
        orderTime: null,
        deliveryAddTime: null,
        custSalesOrderNo: null,
        custMilePaymentAmt: null,
        custOrderStatus: null,
        customerName: null,
        customerNo: null,
        materialMapId: null,
        custSpuId: null,
        site: null,
        importErrorMesg: null,
        errorFlag: null,
        originalQty: null,
        custRelSalesPrice: null,
        errorCode: null,
        returnOrderItemNo: null,
        returnAmt: null,
        returnQty: null,
        salesOrderItemId: null,
        orderTypeName: null,
        seq: null,
        buyerId: null,
        returnType: null,
        mileagePaymentChannel: null,
        shipmentType: null,
        mileageFreight: null,
        custOrderStatusName: null,
        payPrice: null,
        mileagePayPrice: null,
        afterServiceName: null,
        orderDistributionWay: null,
        orderSourceName: null,
        activityId: null,
        activityName: null,
        paymentChannel: null,
        couponDiscount: null,
        mileageCouponDiscount: null,
        canalName: null,
        mileagePaymentTypeName: null,
        attributes: null,
        custRelSalesUnitPrice: null,
        supplierStatus: null,
        contractNo: null,
        unit: null,
        isValid: this.$constant.Y
      },
      page: {
        current: 1,
        pageSize: 10,
        total: 0,
        records: []
      },
      purchaseOrderItemFormDialog: {
        title: '',
        visible: false
      },
      purchaseOrderItemFormData: Object.assign({}, defaultPurchaseOrderItemFormData),
      purchaseOrderItemFormRules: {
        salesOrderId: [{ required: true, message: '销售订单ID不能为空', trigger: 'blur' }],

        salesOrderNo: [{ required: true, message: '销售订单号不能为空', trigger: 'blur' }],

        salesOrderItemNo: [{ required: true, message: '销售订单明细不能为空', trigger: 'blur' }],

      },
      loading: true,
      searchVisible: true,
      multipleSelection: [],
      isSingle: true,
      isMultiple: true
    }
  },
  created() {
    this.handleQuery()
    this.loadOptions()
  },
  methods: {
    loadOptions() {
    },
    handleAdd() {
      this.openPurchaseOrderItemFormDialog()
    },
    handleRemove(row) {
      const ids = row.id || this.multipleSelection.map(item => item.id)
      this.$confirm('是否确认删除数据?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function() {
        return PurchaseOrderItemApi.remove(ids)
      }).then(() => {
        this.handleQuery()
        this.$message.success('删除成功')
      })
    },
    handleEdit(row) {
      const id = row.id || this.multipleSelection.map(item => item.id)[0]
      this.openPurchaseOrderItemFormDialog(id)
    },
    handleQuery() {
      this.loading = true
      PurchaseOrderItemApi.page(this.queryParams, this.page).then(response => {
        this.page.records = response.data.records
        this.page.total = response.data.total
        this.loading = false
      }, () => {
        this.loading = false
      })
    },
    handleExport() {
      this.$confirm('是否确认导出数据?', '警告', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(function() {
        return PurchaseOrderItemApi.exportData(this.queryParams)
      }).then(response => {
        this.$common.download(response.msg)
      })
    },
    openPurchaseOrderItemFormDialog(id) {
      this.purchaseOrderItemFormDialog.visible = true
      if (id) {
        this.purchaseOrderItemFormDialog.title = '采购订单明细-修改'
        PurchaseOrderItemApi.get(id).then(response => {
          this.purchaseOrderItemFormData = {
            ...this.purchaseOrderItemFormData,
            ...response.data
          }
        })
      } else {
        this.purchaseOrderItemFormDialog.title = '采购订单明细-添加'
      }
    },
    confirmPurchaseOrderItemFormDialog() {
      this.$refs['purchaseOrderItemForm'].validate(valid => {
        if (valid) {
          if (this.purchaseOrderItemFormData.id) {
            PurchaseOrderItemApi.edit(this.purchaseOrderItemFormData).then(response => {
              this.$message.success('修改成功')
              this.resetPurchaseOrderItemFormDialog()
              this.handleQuery()
            })
          } else {
            PurchaseOrderItemApi.add(this.purchaseOrderItemFormData).then(response => {
              this.$message.success('添加成功')
              this.resetPurchaseOrderItemFormDialog()
              this.handleQuery()
            })
          }
        }
      })
    },
    resetPurchaseOrderItemFormDialog() {
      this.purchaseOrderItemFormDialog = {
        title: '',
        visible: false
      }
      this.purchaseOrderItemFormData = Object.assign({}, defaultPurchaseOrderItemFormData)
      this.resetForm('purchaseOrderItemForm')
    },
    handleSelectionChange(selection) {
      this.multipleSelection = selection
      this.isSingle = selection.length !== 1
      this.isMultiple = !selection.length
    },
    resetQuery() {
      this.page.current = 1
      this.resetForm('queryForm')
      this.handleQuery()
    }
  }
}
</script>
